package com.example.testapp.activity.activity.study;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.testapp.R;
import com.example.testapp.activity.activity.SuperActivity;

/**
 * Created by l on 2016/10/31.
 */

public class FeedBackActivity extends SuperActivity {

    private EditText  mProblemTV;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.layout_feedback);
        initView();
    }

    private void initView() {
        RelativeLayout headView = (RelativeLayout) this.findViewById(R.id.head);
        RelativeLayout leftBack = (RelativeLayout) this.findViewById(R.id.back_left);
        TextView  title = (TextView) headView.findViewById(R.id.head_title);
        leftBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        title.setText("意见反馈");
        mProblemTV = (EditText)this.findViewById(R.id.problem_text);
        TextView submit = (TextView) this.findViewById(R.id.sumbit);
        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (!TextUtils.isEmpty(mProblemTV.getText().toString())){
                    showToast("您的建议已经成功提交,谢谢您的提议");
                    mProblemTV.setText("");
                }else{
                    showToast("请输入您要提交的意见");
                }
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        mProblemTV.setText("");
    }

    @Override
    protected void obtainInfo() {

    }
}
